package Coding.Exception;

public class TryCatch4 {
    public static void main(String[] args) {

        System.out.println("程序开始了");
        try {
            String str = "a";
            System.out.println(str.toLowerCase());

            System.out.println(str.charAt(0));
            System.out.println(Integer.parseInt(str)); //将字符串转换为整数

        } catch (NullPointerException | StringIndexOutOfBoundsException e) {
            System.out.println("出现了空指针，已经处理了");
        } catch (Exception e) {
            System.out.println("无论出现了什么异常，都在这里得到了解决");
        }
        System.out.println("结束了");


    }
}
